package qnit.test.hibiernate.util;

import java.util.Calendar;
import java.util.Date;

/**
 * 批量生成日期维度表数据
 * 
 * @ClassName: BiDimDate 
 * @author yanjr big123@126.com 
 * @date 2015年5月5日 上午10:26:01
 * @version 0.2  @since 0.1
 */
public class BiDimDate {

	
	
	
	
	public static void createDimDate(Date date) {
		
		
		System.out.println("currdate= " + DateUtils.formatDate(date));
		System.out.println("currdatevar= " + DateUtils.formatDate(date, "yyyyMMdd"));
		System.out.println("DayOfWeek: " + DateUtils.getDayOfWeek(date));
		System.out.println("DayOfMonth: " + DateUtils.getDayOfMonth(date));
		System.out.println("DayOfQuarter: " + DateUtils.getDayOfQuarter(date));
		System.out.println("DayOfYear: " + DateUtils.getDayOfYear(date));
		System.out.println("WeekOfMonth: " + DateUtils.getWeekOfMonth(date));
		System.out.println("WeekOfQuarter: " + DateUtils.getWeekOfQuarter(date));
		System.out.println("WeekOfYear: " + DateUtils.getWeekOfYear(date));
		System.out.println("MonthOfQuarter: " + DateUtils.getMonthOfQuarter(date));
		System.out.println("MonthOfYear: " + DateUtils.getMonthOfYear(date));
		System.out.println("QuarterOfYear: " + DateUtils.getQuarter(date));
		System.out.println("YearNumber: " + DateUtils.getYear(date));
		System.out.println("=======================");
	}
	
	
	
	
	
	
	
	
	
	
	
	
	
	public static void main(String[] args) {
		
		Calendar c = Calendar.getInstance();
		for(int i = 0; i < 100; i++) {
			c.add(Calendar.DATE, 1);
			Date date = c.getTime();
			System.out.println(date);
			createDimDate(date);
		}
		
		
		
	}
	
	
}
